//
//  AppDelegate+Configure.m
//  Cafu
//
//  Created by 帝云科技 on 2018/4/24.
//  Copyright © 2018年 diyunkeji. All rights reserved.
//

#import "AppDelegate+Configure.h"
#import "AppDelegate+ShareSDK.h"
#import "AppDelegate+Pgyer.h"
#import "AppDelegate+Bugly.h"

#import "IQKeyboardManager.h"
#import "DYTabBarController.h"
//#import "DYCheckingAccount.h"


#import "DYGuidePageViewController.h"

@implementation AppDelegate (Configure)

- (void)dy_configure
{
    [self configureRootController];
    [self configureKeyboard];
    [self ShareSDKRegist];
//    [self registPgyer];
//    [self reigstBugly];
//    [DYCheckingAccount dy_checkAccountStatus];
//    [[DYAppContext sharedDYAppContext] checkLogin];
}

- (void)configureRootController
{
    self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    
    if ([[kUserDefaults objectForKey:@"guide"] integerValue] != 1) {
        DYGuidePageViewController *VC = [[DYGuidePageViewController alloc]init];
        self.window.rootViewController = VC;
    }else{
        self.window.rootViewController = [[DYTabBarController alloc]init];
    }

    [self.window makeKeyAndVisible];
}

- (void)configureKeyboard
{
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        IQKeyboardManager *keyBoardManager = [IQKeyboardManager sharedManager];
        keyBoardManager.shouldResignOnTouchOutside = YES;
        keyBoardManager.placeholderFont = [UIFont xhq_font16];
        keyBoardManager.keyboardDistanceFromTextField = 15.0;
    });
}

@end
